@include("layout.header")
<body>
<div id="content" class="content">
    <form id="mainForm" class="main-form layui-form" enctype="application/x-www-form-urlencoded" novalidate="novalidate">
        <div class="tab-title">
            <a class="linkABlue" href="javascript:void(0);">注册</a>
        </div>
        <div class="tip-box visiblility-hidden">
            <i class="err-ico"></i>
            <span class="tip-font"></span>
            <span class="close-ico"></span>
        </div>
        <div class="txt-box visiblility-hidden">
            <span class="">我们已发送一条验证码至 <span id="phoneNum" style="display: inline-block;"></span>，请输入短信中的验证码</span>
        </div>
        <div class='normalInput cycode-box show-cycode' id="cycode-box">
            <div class="cycode-selectbox">
						<span class="cycode-selected">
							<input readonly class="ipt-cycode" id="cycode" value="+86" >
							<i class="arrow-down"></i>
						</span>
                <input id="phone" name="phone" class="ipt-phone inp-focus" maxlength="11" placeholder="手机号码" autocomplete='off' />
            </div>
            <div id="cycode-container" class="cycode-container"></div>
        </div>
        <div class='normalInput'>
            <input class="pl_5 inp-focus" type="text" value="" name="account" id="account" maxlength='50' placeholder='请回答后面的问题' autocomplete='off' />
        </div>

        <div class="layui-form-mid">
            <span style="color: #c00;">
                {{$question}}
            </span>
        </div>
        <span id="j_geetest_error" class="error geetest_error" style="display:none"></span>

        <div id='flymeService' class="rememberField" style="font-size:12px;">
            <label class="pointer" for="acceptFlyme" tabindex="0">点击立即注册，即表示您同意并愿意遵守</label>
            <a href="/serviceAgreement" target='_blank' class="linkABlue">Flyme服务协议</a>
            <label class="pointer">和</label>
            <a href="http://www.meizu.com/legal.html" target='_blank' class="linkABlue">法律声明</a>
        </div>

        <a id="nextStep" class="fullBtnBlue register-btn" lay-submit lay-filter="formDemo" data-step='1'>立即注册</a>
        <a id="toLogin" class="btn-go2register" href="https://login.flyme.cn/login/login.html">登录</a>
    </form>
</div>
<div id="hideWrap" style="width:0; height:0;display:none;overflow:hidden;visibility: hidden;">
    <div id="globalName" style="display:none"></div>
    <div id="globalContainer" style="display:none"></div>
</div>
</body>
<script>
    layui.use(['form','jquery','layer'], function(){
        var $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        form.on('submit(formDemo)', function(data){
            $.ajax({
                type: "POST",
                url: "/reg",
                dataType:"json",
                data: data.field,
                success:(function(msg){
                    if(msg.error ==1){
                        layer.msg(msg.info,function(){

                        });
                    }else{
                        layer.alert(msg.info,function () {
                            location.href ="/regCheck";
                        })
                    }
                })
            })
            return false;
        });
    });
</script>

</html>